Load packages
#load leaflet and other packages
library(leaflet)
library(dplyr)
#Load htmltools
library(htmltools)
#Load spatial packages
library(rgdal)
library(rmapshaper)
# library(devtools)
# install_git('https://github.com/yohanboniface/Leaflet.TileLegend')
# install_git('https://github.com/consbio/Leaflet.HtmlLegend')
Load data from species records and shapefiles (sourced from VicData and Vicforests, then simplified/dissolved in mapshaper)
#Read in LBP csv
LBPdata <- read.csv('data/LBP Records.csv')
#Read in LBP csv
YBGdata <- read.csv('data/YBG Records.csv')
#Read in GG
GGdata <- read.csv('data/GG Records.csv')
#Read in Tree Geebung
Geebungdata <- read.csv('data/Geebung Records.csv')
#Have to use external map shaper as r map shaper cannot handle polygons?
fire.dissolve <- readOGR("data/Fire_Dissolve/fire_sev09_poly.shp")
OGR data source with driver: ESRI Shapefile
Source: "data/Fire_Dissolve/fire_sev09_poly.shp", layer: "fire_sev09_poly"
with 1 features
It has 1 fields
#From using dissolve2 in mapshaper we decrease file size. Now lets run this for all of our polygons
#Logging
logging.dissolve <- readOGR("data/Logging_Dissolve/lastlog25.shp")
OGR data source with driver: ESRI Shapefile
Source: "data/Logging_Dissolve/lastlog25.shp", layer: "lastlog25"
with 1 features
It has 1 fields
#TRP
TRP.dissolve <- readOGR("data/TRP_Dissolve/out.shp")
OGR data source with driver: ESRI Shapefile
Source: "data/TRP_Dissolve/out.shp", layer: "out"
with 1 features
It has 1 fields
Make Icons for LBP, YBG and GG
#For YBG
YBGIcon <- makeIcon(
iconUrl = "data/Icons/YBGIcon.png",
iconWidth = 50, iconHeight = 50,
iconAnchorX = 25, iconAnchorY = 50
)
#For GG
GGIcon <- makeIcon(
iconUrl = "data/Icons/GGIcon.png",
iconWidth = 50, iconHeight = 50,
iconAnchorX = 25, iconAnchorY = 50
)
#For LBP
LBPIcon <- makeIcon(
iconUrl = "data/Icons/LBPIcon.png",
iconWidth = 50, iconHeight = 50,
iconAnchorX = 25, iconAnchorY = 50
)
#For Geebubng
GeebungIcon <- makeIcon(
iconUrl = "data/Icons/geebung2.png",
iconWidth = 50, iconHeight = 50,
iconAnchorX = 25, iconAnchorY = 50
)
Create map with all features
Map that allows us to show/hide layers